package com.ruoyi.device.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.device.domain.HatDeviceRole;
import com.ruoyi.device.domain.req.devicebind.DeviceBindReq;
import com.ruoyi.device.domain.resp.devicebind.DeviceBindResp;
import com.ruoyi.device.service.HatDeviceRoleService;
import com.ruoyi.device.mapper.HatDeviceRoleMapper;
import com.ruoyi.device.util.UpdateRedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
* @author ZhuJunKun
* @description 针对表【hat_device_role(安全帽设备角色绑定表)】的数据库操作Service实现
* @createDate 2023-11-30 17:33:02
*/
@Service
public class HatDeviceRoleServiceImpl extends ServiceImpl<HatDeviceRoleMapper, HatDeviceRole>
    implements HatDeviceRoleService{
    @Override
    public PageInfo<DeviceBindResp> searchByOrgCode(DeviceBindReq req) {
        return PageHelper.startPage(req.getPageSize(),req.getPageNum()).doSelectPageInfo(()->{
            this.baseMapper.search(req);
        });
    }

    @Override
    public boolean unBinding(Integer id) {
       return this.baseMapper.unbinding(id);
    }
}




